import request from '@/config/axios'

// 询价订单 VO
export interface InquiryOrderVO {
  id: number // 订单编号
  no: string // 订单编号
  remark: string // 备注
  status: number // 开启状态
  sort: number // 排序
  productId: number // 产品编号
  customerId: number // 客户编号
}

// 询价订单 API
export const InquiryOrderApi = {
  // 查询询价订单分页
  getInquiryOrderPage: async (params: any) => {
    return await request.get({ url: `/erp/inquiry-order/page`, params })
  },

  // 查询询价订单详情
  getInquiryOrder: async (id: number) => {
    return await request.get({ url: `/erp/inquiry-order/get?id=` + id })
  },

  historyPriceDetail: async (productId: number) => {
    return await request.get({ url: `/erp/inquiry-order/historyPriceDetail?productId=` + productId })
  },


  // 同步订单
  syncOrder: async (id: number) => {
    return await request.post({ url: `/erp/inquiry-order/syncOrder/` + id })
  },

  // 新增询价订单
  createInquiryOrder: async (data: InquiryOrderVO) => {
    return await request.post({ url: `/erp/inquiry-order/create`, data })
  },

  // 修改询价订单
  updateInquiryOrder: async (data: InquiryOrderVO) => {
    return await request.put({ url: `/erp/inquiry-order/update`, data })
  },

  // 删除询价订单
  deleteInquiryOrder: async (id: number) => {
    return await request.delete({ url: `/erp/inquiry-order/delete?id=` + id })
  },

  // 导出询价订单 Excel
  exportInquiryOrder: async (params) => {
    return await request.download({ url: `/erp/inquiry-order/export-excel`, params })
  },
}
